Chronic HCV infection frequently causes neurocognitive (NC) and mood disorders but whether these disorders are caused by HCV or by the concomitant substance use and liver disease is unclear. Response to treatment has been obscured by the neurotoxicity of interferon-based HCV therapies. Newer direct acting antivirals (DAAs) are not neurotoxic and are expected to treat HCV-induced brain injury. However, clinical trials have yet to be performed to determine their central nervous system (CNS) benefits. This presents a critical barrier to progress in the field that the proposed clinical trial will directly address. The overall objective of the proposed partially blinded placebo-controlled trial will be t determine the impact of curing HCV with an oral DAA fixed-dose combination regimen, sofosbuvir and ledipasvir, on CNS outcomes in mono- or HIV co-infected substance users. The specific aims will be to: AIM 1: To determine whether curing HCV, as indexed by 12-week sustained virologic response, results in improvement in NC performance, neuroimaging, and measures of daily functioning; AIM 2: To determine the viral, host, and pharmacologic correlates of neurocognitive and neuroimaging outcomes; and AIM 3: To explore how HIV alters the relationships observed in Aims 1 and 2. The proposed, innovative clinical trial will improve scientific knowledge by determining the biological and imaging correlates of the CNS and systemic effects of DAAs as well as the distribution of these drugs into the CNS. Our findings will also inform clinical guidelines and practice about the safety and benefits of treating HCV in substance using populations. In people who have HIV-associated NC disorder and HCV infection, treatment with DAAs may prove to be a critical adjunct to antiretroviral for improving cognition and returning patients to more functional lives.